<template>
  <div>
    <div>
      <van-cell
        is-link
        @click="showPopup"
        position="bottom"
        :style="{ height: '30%', width: '100%' }"
        >展示弹出层</van-cell
      >
      <van-popup v-model="show"
        ><van-picker
          title="标题"
          show-toolbar
          :columns="columns"
          @confirm="onConfirm"
          @cancel="onCancel"
          @change="onChange"
      /></van-popup>

      <van-search v-model="value" placeholder="请输入搜索关键词" />
    </div>
  </div>
</template>

<script>
import { Toast } from 'vant'
export default {
  data () {
    return {
      value: '',
      columns: ['杭州', '宁波', '温州', '绍兴', '湖州', '嘉兴', '金华', '衢州'],
      show: false
    }
  },

  created () {},

  methods: {
    onConfirm (value, index) {
      Toast(`当前值：${value}, 当前索引：${index}`)
    },
    onChange (picker, value, index) {
      Toast(`当前值：${value}, 当前索引：${index}`)
    },
    onCancel () {
      Toast('取消')
    },
    showPopup () {
      this.show = true
    }
  }
}
</script>

<style scoped lang='less'>
</style>
